< previous page page_513 next page >

Page 513
e10a6a0a59f035e870d90cca05b85fce.gif
' Return a B-spline knot value.
Private Function Knot(ByVal i As Integer, _
    ByVal max As Integer, ByVal degree As Integer) As Integer

    If i < degree Then
        Knot = 0
    ElseIf i <= max Then
        Knot = i - degree + 1
    Else
        Knot = max - degree + 2
    End If
End Function
Example program Bspline uses these routines to draw B-splines much as the program Bezier draws Bezier surfaces. Use the option buttons to select the surface you want to see. Use the arrow keys to change the viewing direction. Click the check boxes to make the program display the control points or the control grid.
Example program Bspline2, shown in Figure 14.28, is a simple B-spline editor. Enter the number of control points you want in the X and Z directions, and click the Initialize
0513-01.jpg
Figure 14.28
Program Bspline2 editing a surface.

 
< previous page page_513 next page >